home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 01.rexx next >
Encoding:
OS/2 REXX Batch file  |  1997-05-10  |  2.7 KB  |  143 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. BrushName = strip(line)
  22. line = readln(TempFile)
  23. Color = strip(line)
  24. line = readln(TempFile)
  25. BackType = strip(line)
  26. line = readln(TempFile)
  27. Width = strip(line)
  28. line = readln(TempFile)
  29. Height = strip(line)
  30. line = readln(TempFile)
  31. XOff = strip(line)
  32. line = readln(TempFile)
  33. YOff = strip(line)
  34. line = readln(TempFile)
  35. Frames = strip(line)
  36. call close TempFile
  37.  
  38. j=0
  39. TFrames = Frames
  40. TNum = 3
  41. if TFrames > 999 then TNum = 4
  42. if TFrames > 9999 then TNum = 5
  43. if Field = 1 then TFrames = Frames*2
  44. do i = 1 to Frames
  45.     call open TempFile,"RAM:VFXNums",W
  46.     call writeln TempFile,right(i,5,'0')
  47.     call writeln TempFile,right(Frames,5,'0')
  48.     call close TempFile
  49.     f=0
  50.     Redraw Off
  51.     j = j+ 1
  52.     call DoIt()
  53.     Redraw On
  54.     call SaveIt()
  55.         if Field = 1 then do
  56.             Redraw Off
  57.             j = j + 1
  58.             call DoIt()
  59.             Redraw On
  60.             call SaveIt()
  61.             end 
  62.     end
  63.     Undo On
  64. exit
  65.  
  66.  
  67. SaveIt:
  68.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  69.         Undo On
  70.         exit
  71.         end
  72.     if SaveType = 0 then do
  73.         call Switcher(TOSW)
  74.         call Switcher(MDV1)
  75.  
  76.         Render Go
  77.         if Field = 1 then
  78.                 call RecordAdd(SaveName,1,6,Compression)
  79.         else
  80.                 call RecordAdd(SaveName,2,6,Compression)
  81.         if j = TFrames then
  82.             call MakeIcon(SaveName,(Frames-10))
  83.         end
  84.  
  85.     if SaveType = 1 then do
  86.         if Field = 1 then do
  87.             f= f + 1
  88.             if f = 1 then
  89.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  90.             if f = 2 then do
  91.                 GetMain
  92.                 parse var result Name Width Height Blah
  93.                 Scale Width Height/2
  94.                 Swap
  95.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  96.                 Scale Width Height/2
  97.                 Hook Interlace
  98.                 SaveBufferAs ILBM SaveName""right(i,TNum,'0')
  99.                 f = 0
  100.                 end
  101.             end
  102.         else do
  103.             SaveBufferAs ILBM SaveName""right(i,TNum,'0')
  104.             end    
  105.         end
  106.  
  107. return
  108.  
  109.  
  110.  
  111.  
  112. DoIt:
  113.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  114.         Undo On
  115.         exit
  116.         end
  117.     if j = 1 then do
  118.         KillBrush
  119.         CreateBuffer Width Height 0 0 0 1 1 100 100 FORCE
  120.         LoadBrush BrushName
  121.         SaveBrushAs "ILBM" "VFXIFX:TempDrawer/BrushA" 
  122.         end
  123.     if j > 1 then do
  124.         LoadBrush "VFXIFX:TempDrawer/BrushA" 
  125.         Roll XOff YOff
  126.         SaveBrushAs "ILBM" "VFXIFX:TempDrawer/BrushA" 
  127.         end
  128.     DrawMode Normal
  129.     Blend 100
  130.     FillMode Tile 0 0 0 Smooth
  131.     FilledBox 0 0 Width Height
  132.     FillMode Solid 0 0 0 Smooth
  133.     if BackType = 1 then do
  134.         DrawMode Colorize
  135.         ActiveColor Color
  136.         FilledBox 0 0 Width Height
  137.         end
  138.     ActiveColor 1
  139.     DrawMode Normal
  140. return
  141.  
  142.  
  143.